import icon
import icon2
import sys
from PyQt4 import QtGui, QtCore

class wapp(QtGui.QWidget):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        
        self.setWindowTitle('test main')
        self.setGeometry(500, 100, 500, 500)
        self.setWindowIcon(QtGui.QIcon('images/Misc/Tools.png'))
        self.setToolTip('This is <b>Test Main App</b>')
        
        bt1 = QtGui.QPushButton('Icon1', self)
        bt1.setGeometry(30, 30, 80, 30)
        
        bt2 = QtGui.QPushButton('Icon2', self)
        bt2.setGeometry(200, 30, 80, 30)
        
        self.connect(bt1, QtCore.SIGNAL('clicked()'), self.ICA)
        self.connect(bt2, QtCore.SIGNAL('clicked()'), self.ICB)
        
        
    def ICA(self):
        sender = self.sender()
        app = QtGui.QApplication(sys.argv)
        AI = icon.Icon()
        AI.show()
        #print "test"
        
    def ICB(self):
        sender = self.sender()
        app = QtGui.QApplication(sys.argv)
        BI = icon2.Icon()
        BI.show()
        #print "test"
        
        
        
app = QtGui.QApplication(sys.argv)
myapp = wapp()
myapp.show()
sys.exit(app.exec_())
